package com.izerui.controller;

import java.util.List;
import java.util.Map;

import nc.vo.framework.rsa.Encode;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.izerui.service.PortalService;

@Controller
public class PortalController {

	@Autowired
	private PortalService portalService;
	@RequestMapping(value="/viewPortalUserList",method=RequestMethod.GET)
	public String viewUserList(ModelMap modelmap){
		List<Map> userList = portalService.getUserList();
		for (Map map : userList) {
			String pass = (String)map.get("PASSWORD");
			Encode encode = new Encode();
			System.out.println(encode.decode(pass));
		}
		modelmap.addAttribute("userList", userList);
		return "portal/list.jsp";
	}
	
	@RequestMapping(value="/initData",method=RequestMethod.GET)
	public String initDataTest(){
		portalService.initData();
		return "success/msg.jsp";
	}
}
